//
//  StellEmumTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/22.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "StellEmumTableViewCell.h"

@interface StellEmumTableViewCell ()
@property (nonatomic,strong) GLGWImageView * selectImageView;
@property (nonatomic,strong) GLGWLabel * nameLabel;
@end

@implementation StellEmumTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectImageView = [[GLGWImageView alloc] initWithImageName:@"uu" inSuperView:self.contentView];
        self.selectImageView.backgroundColor = kRandomColor;
        [self.selectImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(10));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(10));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(10)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(7)));
        }];
        //
        self.nameLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self.contentView];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.selectImageView.mas_right).offset(kWidthProportion_In_iPhoneTriploid(5));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(5));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        
    }
    return self;
}

-(void)setTitleStr:(NSString *)titleStr{
    _titleStr = titleStr;
    self.nameLabel.text = _titleStr;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    if (selected) {
        self.backgroundColor = kColor_Rule_Yellow;
    }else{
        self.backgroundColor = [UIColor whiteColor];
    }
    // Configure the view for the selected state
}

@end
